package edu.aut.bme.hu.orkomet;


import java.util.logging.Handler;
import java.util.logging.LogRecord;
import java.util.logging.Logger;

import com.soyatec.eface.core.collections.ObservableCollection;


class TableLogHandler extends Handler
{
	private ObservableCollection<LogRecordView> logRecords= new ObservableCollection<LogRecordView>();
	
    public ObservableCollection<LogRecordView> getLogRecords() {
		return logRecords;
	}

	public void publish(LogRecord logRecord) {
          logRecords.add(0,new LogRecordView(logRecord));
      }

      public void flush() {
              
      }
      
      public void close() {
          
      }
      
      public void register(String lgName){
    	  Logger.getLogger(lgName).addHandler(this);   
      }
}